load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "etcd",
    srcs = [
        "ca.go",
        "cache.go",
        "cluster.go",
        "compactor.go",
        "relay.go",
        "token.go",
        "user.go",
    ],
    importpath = "go.f110.dev/heimdallr/pkg/database/etcd",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/cert",
        "//pkg/database",
        "//pkg/logger",
        "//pkg/netutil",
        "//vendor/go.etcd.io/etcd/api/v3/mvccpb",
        "//vendor/go.etcd.io/etcd/client/v3:client",
        "//vendor/go.uber.org/zap",
        "//vendor/golang.org/x/xerrors",
        "//vendor/sigs.k8s.io/yaml",
    ],
)

go_test(
    name = "etcd_test",
    srcs = [
        "ca_test.go",
        "cache_test.go",
        "cluster_test.go",
        "compactor_test.go",
        "relay_test.go",
        "token_test.go",
        "user_test.go",
        "util_test.go",
    ],
    embed = [":etcd"],
    deps = [
        "//pkg/cert",
        "//pkg/config/configv2",
        "//pkg/database",
        "//pkg/logger",
        "//pkg/netutil",
        "//vendor/github.com/stretchr/testify/assert",
        "//vendor/github.com/stretchr/testify/require",
        "//vendor/go.etcd.io/etcd/api/v3/etcdserverpb",
        "//vendor/go.etcd.io/etcd/api/v3/mvccpb",
        "//vendor/go.etcd.io/etcd/client/v3:client",
        "//vendor/go.etcd.io/etcd/server/v3/embed",
    ],
)
